<!doctype html>
<html lang="en">	
	<head>
		<meta charset="UTF-8">
		<meta name="Generator" content="EditPlus®">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<title>相邻选择器or ~ 选择器 </title>
		<style>
			*{margin:0;padding:0;}
			a{text-decoration:none;}
			ul,li{list-style:none;}
			body{font-size:12px;font-family:"微软雅黑";}
			h3+p{background:red;}/*+  相邻的后一个兄弟*/
			h1~p{background:yellow;}/*h1的所有兄弟p都生效  有多个h1  只有第一个h1生效*/

		</style>
	</head>
	<body>
		
		<div>
			<p>1</p>
			<p>2</p>
			<p>3</p>
			<h3>h3</h3>
			<p>4</p>
			<p>5</p>
			<h1>h1</h1>
			<p>1</p>
			<p>p
				<div>d1</div>
				<div>d2</div>
				<p>p1</p>
				<p>
					<h1>
						<p>hp</p>
					</h1>
				</p>
			</p>
			<div>
				<p>1</p>
				<p>2</p>
			</div>
			<p>3</p>
			<p>4</p>
			<hr />
			<h1>
				<p>1</p>
				<p>2</p>
				<p>3</p>
			</h1>
		</div>
		<script src="../js/jquery-1.12.2.min.js""></script>
		<script src="../js/dom.js"></script>
		<script type="text/javascript">
			


		</script>	
		
		
	</body>
</html>
